﻿<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="apple-itunes-app" content="app-id=591578609">
<meta name="viewport" content="width=device-width"/>
<meta name="description" content="筑学堂网校" />
<meta name="keywords" content="筑学堂网校、建筑、考试"/>

<link rel="stylesheet" type="text/css" href="../../style/share/style.css">
<link rel="stylesheet" type="text/css" href="../../style/share/kczx.css">
<link rel="stylesheet" type="text/css" href="../../style/share/home_style.css">
<link rel="stylesheet" type="text/css" href="../../style/user.css">
	
<!--[if IE 7]>
<link rel="stylesheet" href="/css/font-awesome/css/font-awesome-ie7.min.css">
<![endif]-->

<script type="text/javascript" src="../../js/home.js"></script>

<script type="text/javascript">

	//取消
	function cancelAdd(){
		$.ajax({ url: "../query_group_main_main/${group_id}", 
		       success: function(result){
	              $("#mainPageDiv").html(result);
	           }
	   });
	}
	
	//保存添加
	function addMemeber(){
		   //发起者ID
		   var sponsor_id = '${user_id}';
		   //接受者ID
		   var adopt_id = $("#member_id").val();
		   
		   var apply_txt = $("#apply_txt").val();
		   
		   $.ajax({url: "../query_homeGroup_member_add/${group_id}/"+sponsor_id+"/"+adopt_id+"/"+apply_txt, 
		       success: function(result){
	           alert(result);
	           
	           if('success'==result){
	        	   $.ajax({ url: "../query_group_main_main/${group_id}", 
	    		       success: function(result){
	    	           $("#mainPageDiv").html(result);
	    	        }
	    	       });
	           }
	        }
		   });
   }

	//取好友id
	function mem_ok(){
		   var id = "";
		   $(":checkbox[name='cb']").each(function(){
			   if($(this).attr("checked")=="checked"){
				   id=id+$(this).val()+",";
			   }
			  
		   });
		   
		   $("#member_id").attr("value",id.substr(0,id.length-1));
		   
		   document.getElementById("memadd").style.display="none";;
		   
		  
   }
</script>
<title>筑学堂家园个人空间</title>
<style type="text/css">
a {
	color:#222;
}
a:hover {
	color:#888;
}
li {
	list-style-type:none;
	border:none;
}
</style>
</head>
<body style="align:center; padding:0;margin:0;clear:both; background-color:FFF;">
	<div class="home_group">
			<div class="home_groupnotice" style="min-height:60px;">
				<div class="home_grnottit">发送请求</div>
				<div class="home_groupnot" style="padding-top:20px;padding-left:10px;"> 
				
				<div style="width:99%;height:30px;">
				<div style="position:relative;float:left;width:260px;height:28px;">
				<span style="font-weight:bold;">接收人：</span>
				<input style="width:200px;height:25px;margin:0;padding:0;zoom:1;" type="text"  id="member_id"/>
				</div>
				<a href="#"onClick="mem_add()">
			<div class="blogadd_textadd" style="position:relative;float:left;top:1px;background-color:#9BA88D;"> 选择好友 </div>
			</a></div>
			
			
				<div id="memadd" style="position:absolute;float:left;width:98%;height:auto;z-indez:1000;display:none;">
				
				<div id="memadddiv" style="position:relative;float:left;width:294px;min-height:48px;background-color:#FAFAFA;height:auto;border:2px solid #20B2AA;margin-left:52px;padding-top:8px;padding-left:8px;">
				
				<c:forEach items="${friends}" var="li">
					<div style="position:relative;float:left;width:140px;height:30px;padding-left:5px;padding-top:2px;">
					<input type="checkbox" value="${li.friendsID}" name="cb" >${li.friendsNm}
					</div>
				</c:forEach>
				<div style="position:relative;float:left;width:99%;height:25px;padding-bottom:2px;padding-top:5px;"><a href="#">
			<div class="blogadd_textadd" style="position:relative;float:left;left:25%;background-color:#209E85;width:60px;"  onClick="mem_ok()"> 确定 </div>
			</a>
			
			<div style="position:relative;float:left;left:30%;margin-left:10px;"><a href="#" onClick="mem_del()">取消</a> </div>
				
				</div>
				
				</div>
				</div>
				
				<br/>
				<br/>
				<span style="font-weight:bold;vertical-align:top;">内&nbsp;&nbsp;&nbsp;容：</span>
				<textarea style="width:500px;height:150px;"  id="apply_txt">  </textarea>
				</div>
				
				<div class="blogadd_title01" style="width:98%;margin-top:40px;">
			<a href="#" onclick="addMemeber()">
			  <div class="blogadd_textadd" style="position:relative;float:left;left:35%;background-color:#209E85;"> 发布请求 </div>
			</a>
			
			 <div style="position:relative;float:left;left:35%;margin-left:10px;">
			    <a href="#" onclick="cancelAdd()"> 取消</a>
			 </div>
		</div>
				
			</div>
		</div>
</body>
</html>